<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>geo</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">
    <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
                <h1><img src="../assets/css/logo.png" title="" width="117" height="52"></h1>
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: </em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
                    <h2 class="off-left">APIs</h2>
                    <div id="api-tabview" class="tabview">
                        <ul class="tabs">
                            <li><a href="#api-classes">Classes</a></li>
                            <li><a href="#api-modules">Modules</a></li>
                        </ul>
                
                        <div id="api-tabview-filter">
                            <input type="search" id="api-filter" placeholder="Type to filter APIs">
                        </div>
                
                        <div id="api-tabview-panel">
                            <ul id="api-classes" class="apis classes">
                                <li><a href="../classes/BBox.html">BBox</a></li>
                                <li><a href="../classes/geo.html">geo</a></li>
                                <li><a href="../classes/GL.html">GL</a></li>
                                <li><a href="../classes/gl.html">gl</a></li>
                                <li><a href="../classes/GL.Buffer.html">GL.Buffer</a></li>
                                <li><a href="../classes/GL.FBO.html">GL.FBO</a></li>
                                <li><a href="../classes/GL.Indexer.html">GL.Indexer</a></li>
                                <li><a href="../classes/GL.Mesh.html">GL.Mesh</a></li>
                                <li><a href="../classes/GL.Octree.html">GL.Octree</a></li>
                                <li><a href="../classes/GL.Shader.html">GL.Shader</a></li>
                                <li><a href="../classes/GL.Texture.html">GL.Texture</a></li>
                                <li><a href="../classes/LEvent.html">LEvent</a></li>
                            </ul>
                
                
                            <ul id="api-modules" class="apis modules">
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
                    Show:
                    <label for="api-show-inherited">
                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited
                    </label>
            
                    <label for="api-show-protected">
                        <input type="checkbox" id="api-show-protected">
                        Protected
                    </label>
            
                    <label for="api-show-private">
                        <input type="checkbox" id="api-show-private">
                        Private
                    </label>
                    <label for="api-show-deprecated">
                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated
                    </label>
            
                </div>
            
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
<h1>geo Class</h1>
<div class="box meta">


        <div class="foundat">
            Defined in: <a href="../files/.._src_geo.js.html#l11"><code>..&#x2F;src&#x2F;geo.js:11</code></a>
        </div>


</div>


<div class="box intro">
    <p>Computational geometry algorithms, is a static class</p>

</div>


<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods">
                            <li class="index-item method">
                                <a href="#method_createPlane">createPlane</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_distance2PointToPlane">distance2PointToPlane</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_distancePointToPlane">distancePointToPlane</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_extractPlanes">extractPlanes</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_frustumTestBox">frustumTestBox</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_frustumTestSphere">frustumTestSphere</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_project2DPointOnLine">project2DPointOnLine</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_projectPointOnLine">projectPointOnLine</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_projectPointOnPlane">projectPointOnPlane</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_reflectPointInPlane">reflectPointInPlane</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_testBBoxBBox">testBBoxBBox</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_testPoint2DInPolygon">testPoint2DInPolygon</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_testPointBBox">testPointBBox</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_testRayBBox">testRayBBox</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_testRayBox">testRayBox</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_testRayCylinder">testRayCylinder</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_testRayPlane">testRayPlane</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_testRaySphere">testRaySphere</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_testSegmentPlane">testSegmentPlane</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_testSphereBBox">testSphereBBox</a>

                            </li>
                    </ul>
                </div>



        </div>

            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

<div id="method_createPlane" class="method item">
    <h3 class="name"><code>createPlane</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>P</code>
                </li>
                <li class="arg">
                        <code>N</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Vec4</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l18"><code>..&#x2F;src&#x2F;geo.js:18</code></a>
        </p>



    </div>

    <div class="description">
        <p>Returns a float4 containing the info about a plane with normal N and that passes through point P</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">P</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">N</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Vec4</span>:
                    <p>plane values</p>

            </div>
        </div>


</div>
<div id="method_distance2PointToPlane" class="method item">
    <h3 class="name"><code>distance2PointToPlane</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>point</code>
                </li>
                <li class="arg">
                        <code>plane</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Number</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l42"><code>..&#x2F;src&#x2F;geo.js:42</code></a>
        </p>



    </div>

    <div class="description">
        <p>Computes the square distance between the point and the plane</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">point</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">plane</code>
                        <span class="type">Vec4</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Number</span>:
                    <p>distance*distance</p>

            </div>
        </div>


</div>
<div id="method_distancePointToPlane" class="method item">
    <h3 class="name"><code>distancePointToPlane</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>point</code>
                </li>
                <li class="arg">
                        <code>plane</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Number</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l30"><code>..&#x2F;src&#x2F;geo.js:30</code></a>
        </p>



    </div>

    <div class="description">
        <p>Computes the distance between the point and the plane</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">point</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">plane</code>
                        <span class="type">Vec4</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Number</span>:
                    <p>distance</p>

            </div>
        </div>


</div>
<div id="method_extractPlanes" class="method item">
    <h3 class="name"><code>extractPlanes</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>viewprojection</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Float32Array</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l575"><code>..&#x2F;src&#x2F;geo.js:575</code></a>
        </p>



    </div>

    <div class="description">
        <p>extract frustum planes given a view-projection matrix</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">viewprojection</code>
                        <span class="type">Mat4</span>


                    <div class="param-description">
                        <p>matrix</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Float32Array</span>:
                    <p>returns all 6 planes in a float32array[24]</p>

            </div>
        </div>


</div>
<div id="method_frustumTestBox" class="method item">
    <h3 class="name"><code>frustumTestBox</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>planes</code>
                </li>
                <li class="arg">
                        <code>boundindbox</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Enum</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l624"><code>..&#x2F;src&#x2F;geo.js:624</code></a>
        </p>



    </div>

    <div class="description">
        <p>test a BBox against the frustum</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">planes</code>
                        <span class="type">Float32Array</span>


                    <div class="param-description">
                        <p>frustum planes</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">boundindbox</code>
                        <span class="type"><a href="../classes/BBox.html" class="crosslink">BBox</a></span>


                    <div class="param-description">
                        <p>in BBox format</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Enum</span>:
                    <p>CLIP_INSIDE, CLIP_OVERLAP, CLIP_OUTSIDE</p>

            </div>
        </div>


</div>
<div id="method_frustumTestSphere" class="method item">
    <h3 class="name"><code>frustumTestSphere</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>center</code>
                </li>
                <li class="arg">
                        <code>radius</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Enum</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l651"><code>..&#x2F;src&#x2F;geo.js:651</code></a>
        </p>



    </div>

    <div class="description">
        <p>test a Sphere against the frustum</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">center</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>sphere center</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">radius</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>sphere radius</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Enum</span>:
                    <p>CLIP_INSIDE, CLIP_OVERLAP, CLIP_OUTSIDE</p>

            </div>
        </div>


</div>
<div id="method_project2DPointOnLine" class="method item">
    <h3 class="name"><code>project2DPointOnLine</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>P</code>
                </li>
                <li class="arg">
                        <code>A</code>
                </li>
                <li class="arg">
                        <code>B</code>
                </li>
                <li class="arg">
                        <code>result</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Vec2</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l76"><code>..&#x2F;src&#x2F;geo.js:76</code></a>
        </p>



    </div>

    <div class="description">
        <p>Projects a 2D point on a 2D line</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">P</code>
                        <span class="type">Vec2</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">A</code>
                        <span class="type">Vec2</span>


                    <div class="param-description">
                        <p>line start</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">B</code>
                        <span class="type">Vec2</span>


                    <div class="param-description">
                        <p>line end</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type">Vec2</span>


                    <div class="param-description">
                        <p>to store result (optional)</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Vec2</span>:
                    <p>projectec point</p>

            </div>
        </div>


</div>
<div id="method_projectPointOnLine" class="method item">
    <h3 class="name"><code>projectPointOnLine</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>P</code>
                </li>
                <li class="arg">
                        <code>A</code>
                </li>
                <li class="arg">
                        <code>B</code>
                </li>
                <li class="arg">
                        <code>result</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Vec3</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l54"><code>..&#x2F;src&#x2F;geo.js:54</code></a>
        </p>



    </div>

    <div class="description">
        <p>Projects a 3D point on a 3D line</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">P</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">A</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>line start</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">B</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>line end</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>to store result (optional)</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Vec3</span>:
                    <p>projectec point</p>

            </div>
        </div>


</div>
<div id="method_projectPointOnPlane" class="method item">
    <h3 class="name"><code>projectPointOnPlane</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>point</code>
                </li>
                <li class="arg">
                        <code>P</code>
                </li>
                <li class="arg">
                        <code>N</code>
                </li>
                <li class="arg">
                        <code>result</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Vec3</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l97"><code>..&#x2F;src&#x2F;geo.js:97</code></a>
        </p>



    </div>

    <div class="description">
        <p>Projects point on plane</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">point</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">P</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>plane point</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">N</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>plane normal</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>to store result (optional)</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Vec3</span>:
                    <p>projectec point</p>

            </div>
        </div>


</div>
<div id="method_reflectPointInPlane" class="method item">
    <h3 class="name"><code>reflectPointInPlane</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>point</code>
                </li>
                <li class="arg">
                        <code>P</code>
                </li>
                <li class="arg">
                        <code>N</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Vec3</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l114"><code>..&#x2F;src&#x2F;geo.js:114</code></a>
        </p>



    </div>

    <div class="description">
        <p>Finds the reflected point over a plane (useful for reflecting camera position when rendering reflections)</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">point</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>point to reflect</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">P</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>point where the plane passes</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">N</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>normal of the plane</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Vec3</span>:
                    <p>reflected point</p>

            </div>
        </div>


</div>
<div id="method_testBBoxBBox" class="method item">
    <h3 class="name"><code>testBBoxBBox</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>a</code>
                </li>
                <li class="arg">
                        <code>b</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l460"><code>..&#x2F;src&#x2F;geo.js:460</code></a>
        </p>



    </div>

    <div class="description">
        <p>test if a BBox overlaps another BBox</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">a</code>
                        <span class="type"><a href="../classes/BBox.html" class="crosslink">BBox</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">b</code>
                        <span class="type"><a href="../classes/BBox.html" class="crosslink">BBox</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>true if it overlaps</p>

            </div>
        </div>


</div>
<div id="method_testPoint2DInPolygon" class="method item">
    <h3 class="name"><code>testPoint2DInPolygon</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>poly</code>
                </li>
                <li class="arg">
                        <code>point</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l686"><code>..&#x2F;src&#x2F;geo.js:686</code></a>
        </p>



    </div>

    <div class="description">
        <p>test if a 2d point is inside a 2d polygon</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">poly</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>array of 2d points</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">point</code>
                        <span class="type">Vec2</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>true if it is inside</p>

            </div>
        </div>


</div>
<div id="method_testPointBBox" class="method item">
    <h3 class="name"><code>testPointBBox</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>point</code>
                </li>
                <li class="arg">
                        <code>bbox</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l445"><code>..&#x2F;src&#x2F;geo.js:445</code></a>
        </p>



    </div>

    <div class="description">
        <p>test if a 3d point is inside a BBox</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">point</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">bbox</code>
                        <span class="type"><a href="../classes/BBox.html" class="crosslink">BBox</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>true if it is inside</p>

            </div>
        </div>


</div>
<div id="method_testRayBBox" class="method item">
    <h3 class="name"><code>testRayBBox</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>origin</code>
                </li>
                <li class="arg">
                        <code>direction</code>
                </li>
                <li class="arg">
                        <code>box</code>
                </li>
                <li class="arg">
                        <code>model</code>
                </li>
                <li class="arg">
                        <code>result</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l411"><code>..&#x2F;src&#x2F;geo.js:411</code></a>
        </p>



    </div>

    <div class="description">
        <p>test a ray bounding-box collision, it uses the  BBox class and allows to use non-axis aligned bbox</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">origin</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>ray origin</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">direction</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>ray direction</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">box</code>
                        <span class="type"><a href="../classes/BBox.html" class="crosslink">BBox</a></span>


                    <div class="param-description">
                        <p>in BBox format</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">model</code>
                        <span class="type">Mat4</span>


                    <div class="param-description">
                        <p>transformation of the BBox [optional]</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>collision position in world space unless in_local is true</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>returns if the ray collides the box</p>

            </div>
        </div>


</div>
<div id="method_testRayBox" class="method item">
    <h3 class="name"><code>testRayBox</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>start</code>
                </li>
                <li class="arg">
                        <code>direction</code>
                </li>
                <li class="arg">
                        <code>minB</code>
                </li>
                <li class="arg">
                        <code>maxB</code>
                </li>
                <li class="arg">
                        <code>result</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l323"><code>..&#x2F;src&#x2F;geo.js:323</code></a>
        </p>



    </div>

    <div class="description">
        <p>test a ray bounding-box collision and retrieves the collision point, the BB must be Axis Aligned</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">start</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>ray start</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">direction</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>ray direction</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">minB</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>minimum position of the bounding box</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">maxB</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>maximim position of the bounding box</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>collision position</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>returns if the ray collides the box</p>

            </div>
        </div>


</div>
<div id="method_testRayCylinder" class="method item">
    <h3 class="name"><code>testRayCylinder</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>start</code>
                </li>
                <li class="arg">
                        <code>direction</code>
                </li>
                <li class="arg">
                        <code>p</code>
                </li>
                <li class="arg">
                        <code>q</code>
                </li>
                <li class="arg">
                        <code>r</code>
                </li>
                <li class="arg">
                        <code>result</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l234"><code>..&#x2F;src&#x2F;geo.js:234</code></a>
        </p>



    </div>

    <div class="description">
        <p>test a ray cylinder collision (only vertical cylinders) and retrieves the collision point [not fully tested]</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">start</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>ray start</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">direction</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>ray direction</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">p</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>center of the cylinder</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">q</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>height of the cylinder</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">r</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>radius of the cylinder</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>collision position</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>returns if the ray collides the cylinder</p>

            </div>
        </div>


</div>
<div id="method_testRayPlane" class="method item">
    <h3 class="name"><code>testRayPlane</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>start</code>
                </li>
                <li class="arg">
                        <code>direction</code>
                </li>
                <li class="arg">
                        <code>P</code>
                </li>
                <li class="arg">
                        <code>N</code>
                </li>
                <li class="arg">
                        <code>result</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l132"><code>..&#x2F;src&#x2F;geo.js:132</code></a>
        </p>



    </div>

    <div class="description">
        <p>test a ray plane collision and retrieves the collision point</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">start</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>ray start</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">direction</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>ray direction</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">P</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>point where the plane passes</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">N</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>normal of the plane</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>collision position</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>returns if the ray collides the plane or the ray is parallel to the plane</p>

            </div>
        </div>


</div>
<div id="method_testRaySphere" class="method item">
    <h3 class="name"><code>testRaySphere</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>start</code>
                </li>
                <li class="arg">
                        <code>direction</code>
                </li>
                <li class="arg">
                        <code>center</code>
                </li>
                <li class="arg">
                        <code>radius</code>
                </li>
                <li class="arg">
                        <code>result</code>
                </li>
                <li class="arg">
                        <code>max_dist</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l187"><code>..&#x2F;src&#x2F;geo.js:187</code></a>
        </p>



    </div>

    <div class="description">
        <p>test a ray sphere collision and retrieves the collision point</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">start</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>ray start</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">direction</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>ray direction (normalized)</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">center</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>center of the sphere</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">radius</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>radius of the sphere</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>[optional] collision position</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">max_dist</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>not fully tested</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>returns if the ray collides the sphere</p>

            </div>
        </div>


</div>
<div id="method_testSegmentPlane" class="method item">
    <h3 class="name"><code>testSegmentPlane</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>start</code>
                </li>
                <li class="arg">
                        <code>end</code>
                </li>
                <li class="arg">
                        <code>P</code>
                </li>
                <li class="arg">
                        <code>N</code>
                </li>
                <li class="arg">
                        <code>result</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l156"><code>..&#x2F;src&#x2F;geo.js:156</code></a>
        </p>



    </div>

    <div class="description">
        <p>test collision between segment and plane and retrieves the collision point</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">start</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>segment start</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">end</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>segment end</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">P</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>point where the plane passes</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">N</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>normal of the plane</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                        <p>collision position</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>returns if the segment collides the plane or it is parallel to the plane</p>

            </div>
        </div>


</div>
<div id="method_testSphereBBox" class="method item">
    <h3 class="name"><code>testSphereBBox</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>point</code>
                </li>
                <li class="arg">
                        <code>radius</code>
                </li>
                <li class="arg">
                        <code>bounding_box</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_geo.js.html#l492"><code>..&#x2F;src&#x2F;geo.js:492</code></a>
        </p>



    </div>

    <div class="description">
        <p>test if a sphere overlaps a BBox</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">point</code>
                        <span class="type">Vec3</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">radius</code>
                        <span class="type">Float</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">bounding_box</code>
                        <span class="type"><a href="../classes/BBox.html" class="crosslink">BBox</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>true if it overlaps</p>

            </div>
        </div>


</div>
            </div>



    </div>
</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
